Type 1 if you want pin stripes, 0 if not ? 0 Type 1 if you want anti-lock brakes, 0 if not ? 1 Final price: 20800
This time, only the second optional true branch was executed.
Here is the program again:
LET PRICE = 20000 ' PRINT "Type 1 if you want pin stripes, 0 if not" INPUT STRIPES ' IF STRIPES > 0 THEN LET PRICE = PRICE + 250 END IF ' PRINT "Type 1 if you want anti-lock brakes, 0 if not" INPUT BRAKES ' IF BRAKES > 0 THEN LET PRICE = PRICE + 800 END IF ' PRINT "Final price:", PRICE END
Here is a chart that shows how it works:
Each true branch is like a "side-trip" that adds something
to the PRICE
.
Both side-trips might be taken.
What will the monitor screen look like for a user that wants both options?